package Demo02;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28463
 * Date: 2022—05—29
 * Time: 8:19
 */
public class Test04 {
    public static void main(String[] args) {
                Scanner in = new Scanner(System.in);
                String str =  in.nextLine();
                String[] strings = str.split(" ");
                System.out.println(strings[strings.length-1].length());
    }

    public static void main7(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("使用nextline方式接收字符串:");
        //判断用户有没有输入字符串
        if(sc.hasNextLine()){
            String s = sc.nextLine();
            System.out.println("输出的内容为:"+s);
        }
        sc.close();
    }
    public static void main5(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] str = new String[5];
        int i = 0;
        while (sc.hasNext()) {
            str[i] = sc.next();
            i++;
            for (int j = 0; j < i; j++) {
                System.out.println(str[j]);
            }
        }
    }
    public static void main4(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str1 =null ;
        System.out.println("输入的字符串为：");
        str1 = sc.nextLine();
        System.out.println("输出的字符串为：");
        System.out.println(str1);

    }
    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str1 =null ;
        System.out.println("输入的字符串为：");
        str1 = sc.next();
        System.out.println("输出的字符串为：");
        System.out.println(str1);
    }
    public static void main2(String[] args) {
        String s1,s2;
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入第一个字符串：");
        s1=sc.next();
        sc.nextLine();
        System.out.print("请输入第二个字符串：");
        s2=sc.nextLine();
        System.out.println("输入的字符串是："+s1+" "+s2);
    }
    public static void main1(String[] args) {
        String s1,s2;
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入第一个字符串：");
        s1=sc.nextLine();
        System.out.print("请输入第二个字符串：");

        s2=sc.next();
        System.out.println("输入的字符串是："+s1+" "+s2);
    }
}
